package com.xc.demo.controller;


import com.xc.demo.common.Result;
import com.xc.demo.entity.Banner;
import com.xc.demo.mapper.BannerMapper;
import com.xc.demo.service.BannerService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    BannerService bannerService;

    @Resource
    BannerMapper bannerMapper;


    @GetMapping
    public Result getPics(){

       return Result.success(bannerMapper.selectById(1));
    }


    @PostMapping
    public Boolean saveBanner(@RequestBody Banner banner){
      return (bannerService.saveOrUpdate(banner));
    }


}
